define(function(require,exports,module){
    require("jquery");
    $(".reward-btn").on("toggle",function(event){
        if(event.detail.isActive){
            console.log("你启动了开关");
            // 开启
        }else{
            // 关闭
            console.log("你关闭了开关");
        }
    })

    var picker = new mui.PopPicker();
    picker.setData([
        {value:'1',text:'0.00%'},
        {value:'2',text:'10.00%'},
        {value:'3',text:'20.00%'},
        {value:'4',text:'30.00%'},
        {value:'5',text:'40.00%'},
        {value:'6',text:'50.00%'},
        {value:'7',text:'60.00%'},
        {value:'8',text:'99.4%'},
    ]);
    $(".percent").on("tap",function(){
        picker.show(function(getSelectedItems){
            $(".percent-num").text(getSelectedItems[0].text)
            // console.log(getSelectedItems)
        });
    })
    $(".confirm").on("click",function(){
        var numarr = [];
        var pass;
        $(".input-div input").each(function(i,e){
            if($(e).val() == ""){
                mui.toast("赞赏的金额输入不能为空");
                pass = 0;
                return false;
            }else{
                numarr.push($(e).val());
                pass = 1;
            }
        })
        if(pass){
            numstr = numarr.join("、");
            $(".reward-num").text(numstr);
            mui('#numsheet').popover('toggle');
        }else{
            return false;
        }
    })
})
